package politic;

public class PoliticaAzar extends Politica {

	private Double limite;
	public static Double DEFAULT_VALUE = 0.1;
	public PoliticaAzar(Double limite){
		if(limite<=1 && limite>0)
			this.limite=limite;
		else
			this.limite = PoliticaAzar.DEFAULT_VALUE;
	}
	@Override
	public boolean aceptar(Integer userId) {
		double nroAleatorio = Math.random();
		if(nroAleatorio<this.limite)
			return true;
		return false;
	}

}
